{extend name="public:layout" /}
{block name="title"}店铺管理{/block}
{block name="head"}
<style>
    .area_name select{width:33%;float:left;}
</style>
{/block}
{block name="body"}
<div class="wrapper wrapper-content">
    <div class="ibox">
        <div class="ibox-title">
            <ol class="breadcrumb">
                <li><i class="fa fa-hand-o-right"></i> <a href="{:url('index')}"> 店铺列表</a></li>
                <li class="active">编辑店铺</li>
            </ol>
        </div>
        <div class="ibox-content">
            <form method="post" class="form-horizontal" id="form">
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺名称"
                               name="site_name" value="{$info.site_name}" datatype="*" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">公司名称</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入公司名称"
                               name="company_name" value="{$info.company_name}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">营业执照</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入营业执照号"
                               name="site_no" value="{$info.site_no}" datatype="*" nullmsg="请输入营业执照号" />
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺分类</label>
                    <div class="col-sm-4">
                        <select name="site_class_id" class="form-control">
                            <option value="0">请选择</option>
                            {volist name="siteClass" id="vo"}
                            <option value="{$vo.site_class_id}" {eq name="vo['site_class_id']" value="$info['site_class_id']"}selected{/eq}>{$vo.site_class_name}</option>
                            {/volist}
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">推荐店铺</label>
                    <div class="col-sm-4">
                        <label class="radio-inline i-checks">
                            <input type="radio" name="site_recommend" value="1" {eq name="info.site_recommend" value="1"}checked{/eq}> 是
                        </label>
                        <label class="radio-inline i-checks">
                            <input type="radio" name="site_recommend" value="0" {eq name="info.site_recommend" value="0"}checked{/eq}> 否
                        </label>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺状态</label>
                    <div class="col-sm-4">
                        <select name="site_status" class="form-control">
                            <option value="0" {eq name="info.site_status" value="0"}selected{/eq}>关闭</option>
                            <option value="1" {eq name="info.site_status" value="1"}selected{/eq}>开启</option>
                            <option value="2" {eq name="info.site_status" value="2"}selected{/eq}>审核中</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺等级</label>
                    <div class="col-sm-4">
                        <select name="grade_id" class="form-control">
                            <option value="5" {eq name="info.grade_id" value="5"}selected{/eq}>★★★★★</option>
                            <option value="4" {eq name="info.grade_id" value="4"}selected{/eq}>★★★★</option>
                            <option value="3" {eq name="info.grade_id" value="3"}selected{/eq}>★★★</option>
                            <option value="2" {eq name="info.grade_id" value="2"}selected{/eq}>★★</option>
                            <option value="1" {eq name="info.grade_id" value="1"}selected{/eq}>★</option>
                        </select>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺电话</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺电话"
                               name="site_tel" value="{$info.site_tel}" datatype="*" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">营业执照</label>
                    <div class="col-sm-4">
                        <p class="form-control-static">
                            {:widget('common/Form/singleImg',['field'=>'site_image','value'=>$info['site_image'],$uid])}
                        </p>
                    </div>
                    <label class="col-sm-2 control-label Validform_label">店铺坐标</label>
                    <div class="col-sm-4">
                        <div class="input-group">
                            <input type="text" class="form-control" name="coordinate" value="{$info.lat},{$info.lng}">
                            <span class="input-group-btn"> <button onclick="getpos()" type="button" class="btn btn-primary">定位
                                        </button> </span>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺地址</label>
                    <div class="col-sm-6">
                        {php}
                            $areaValue = $info['prov_id'].','.$info['city_id'].','.$info['dist_id'];
                        {/php}
                        {:widget('common/Form/areaName',['prov_id,city_id,dist_id',$areaValue])}
                    </div>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺地址"
                               name="address" value="{$info.address}" />
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-2 control-label Validform_label">店铺排序</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" placeholder="请输入店铺排序"
                               name="site_sort" value="{$info.site_sort}" datatype="n" />
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-10 col-sm-offset-2">
                        <button class="btn btn-primary" type="button" id="btnSub">保存内容</button>
                        <a href="{:url('index')}" class="btn btn-white">取消</a>
                        <span id="validError"></span>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
    $(function () {
        iCheck();
        ajaxSubForm('#btnSub');
    });
    function getpos() {
        In('layer',function () {
            layer.open({
                type: 2,
                title: '请点击后复制坐标',
                shadeClose:true,
                area: ['90vw', '90vh'],
                anim: 2,
                content: ["{:url('/plus/Bmap/getPos')}"] //iframe的url，no代表不显示滚动条
            });
        })

    }
</script>
{/block}